import java.util.*;
public class Solution {
    public static void main(String[] args) {
        int B[] = {1,2,3};
        int A[] = {4,5,6};
        int m = 3;
        int n = 3;
        merge(A,m,B,n);
    }
    public static void merge(int A[], int m, int B[], int n) {
        int [] arr = new int[m+n];
        for(int i = 0 ; i<m;i++){
            arr[i] = A[i];
        }
        for(int i = 0 ; i<n;i++){
            arr[m+i] = B[i];
        }
        Arrays.sort(arr);
        System.out.printf(Arrays.toString(arr));
    }
}